library(tidyverse)library(lubridate)# REQUIRED PARAMETERS ----------------------------------------------------------## File locationsroot_dir <-"~/Desktop"# Where to put NTL folderfolder_name <-"NTL Analysis"# The code will create this folder## Countryiso3_code <-"NGA"# ISO3 code for country## Tokennasa_bearer <-"BEARER-TOKEN"# NASA Bearer Token# OPTIONAL PARAMETERS ----------------------------------------------------------## Years to Queryyear_start <-2012year_end <-Sys.Date() %>%year()## Months to querymonth_start <-"2012-01-01"# Start month to query month_end <-Sys.Date() %>%# End month to queryfloor_date(unit ="months") %>%as.character() # Base year for % change mapspc_base_year <-2019
Nighttime lights have become a commonly used resource to estimate changes in local economic activity. This document analyzes nighttime lights within the country.
Data
We use nighttime lights data from VIIRS Black Marble. Raw nighttime lights data requires correction due to cloud cover and stray light, such as lunar light. The Black Marble dataset applies advanced algorithms to correct raw nighttime light values and calibrate data so that trends in lights over time can be meaningfully analyzed. From VIIRS Black Marble, we use data from January 2012 through present—where data is available at a 500-meter resolution.
Methodology
Within different units of analysis (e.g, administrative units) we use the sum of nighttime lights. Where relevant, we distinguish between lights generated from gas flaring and lights removing gas flaring. We use the World Bank’s Global Gas Flaring Tracker which indicates the location of gas flaring locations. When removing gas flaring lights, we remove lights within 10km of a gas flaring location; when looking at lights in gas flaring locations, we take the sum of lights within 10km of gas flaring locations.
We use a dataset from GHSL that maps the locations of all cities. We extract total nighttime lights each city. The below figure compares nighttime lights with population.